package cn.handong.tool.algorithm.多线程;

public class TestThread1 {
    public static void main(String[] args) {
        TestRunnable tr1 = new TestRunnable("C");
        TestRunnable tr2 = new TestRunnable("D");
        new Thread(tr1).start();
        new Thread(tr2).start();
    }
}
class TestRunnable implements Runnable{
    String name;
    public TestRunnable(String name){
        this.name=name;
    }
    @Override
    public void run() {
        for (int i = 0; i < 6; i++) {
            System.out.println(this.name+":"+i);
        }
    }
}